package com.uphone.magicleafteacher.pro.adapter;

import android.support.annotation.NonNull;
import android.text.TextUtils;

import com.blankj.utilcode.util.SizeUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.uphone.magicleafteacher.R;
import com.uphone.magicleafteacher.util.CommonUtil;
import com.uphone.magicleafteacher.view.MyBaseViewHolder;
import com.uphone.magicleafteacher.vo.ClassWorkBean;

public class CourseLiveWorkAdapter extends BaseQuickAdapter<ClassWorkBean.HomeworkBean, MyBaseViewHolder> {
    public CourseLiveWorkAdapter() {
        super(R.layout.item_course_live_work);
    }

    @Override
    protected void convert(@NonNull MyBaseViewHolder helper, ClassWorkBean.HomeworkBean item) {
        helper.setImageViewCorner(mContext, R.id.iv_pic, CommonUtil.getImageUrl(item.getWorkPic()), SizeUtils.dp2px(8))
                .setGone(R.id.iv_pic, !TextUtils.isEmpty(item.getWorkPic()))
                .addOnClickListener(R.id.iv_pic)
                .setText(R.id.tv_title, CommonUtil.getStr(item.getTitle()))
                .setText(R.id.tv_content, CommonUtil.getStr(item.getRequest()));
    }
}
